function login() {
    //获取用户输入的用户和密码，通过Ajax发送给服务器
    let account = $("#account").val();

    let password = $("#password").val();

    let code = $("#code").val();

    $.ajax("login", {
        type: "POST",
        data: {
            account: account,
            password: password,
            code:code
        },
        success: function(data, textStatus) {

            // var dataList = data.split("\r\n");
            let datas = JSON.parse(data);
            if (datas.statusCode == 200) {
                let user = JSON.stringify(datas.datas.user);
                sessionStorage.setItem("admin", user);


                alert(datas.errMsg);
				
				
				location.href=datas.location+".html";
               


            } else {
                alert(datas.errMsg)
            }
        }
    })

}
